<?php

namespace App\Admin\Repositories;

use App\Models\SystemRegion as Model;
use Dcat\Admin\Repositories\EloquentRepository;

class SystemRegion extends EloquentRepository
{
    /**
     * Model.
     *
     * @var string
     */
    protected $eloquentClass = Model::class;

    /**
     * 获得地区列表 select 选择器使用
     * @return array
     */
    public static function getList()
    {
        $list = \App\Models\SystemRegion::get();
        $res = [];
        foreach ($list as $listVal) {
            $res[$listVal->id] = $listVal->region_name;
        }
        return $res;
    }
}
